Hierarchical hidden Markov model